


#ifndef PF_FLAGS_H
#define PF_FLAGS_H

#include "lx_define.h"
#include "pf_debug.h"
#include "lx_Export.h"

/**
 * Base class for objects which have flags.
 *

 */
class LX_EXPORT PF_Flags {
public:
    /** Default constructor. Resets all flags to 0. */
    PF_Flags() {
        flags = 0;
    }

    /** Constructor with initialisation to the given flags. */
    PF_Flags(unsigned int f) {
        flags = f;
    }

    virtual ~PF_Flags() {}

    unsigned int getFlags() const {
        return flags;
    }

    void resetFlags() {
        flags=0;
    }

    void setFlags(unsigned int f) {
        flags=f;
    }

    void setFlag(unsigned int f) {
        flags=flags|f;
    }

    void delFlag(unsigned int f) {
        flags=flags&(~f);
    }

    void toggleFlag(unsigned int f) {
        flags=flags^f;
    }

    bool getFlag(unsigned int f) const {
        if(flags&f) {
            return true;
        } else {
            return false;
        }
    }

private:
    unsigned int flags;
};

#endif
